using System;
using System.Collections.Generic;

namespace ASPNETVN.PORTAL.Components.Configuration.Items
{
    public class Tab : IComparable
    {
        private IList<Module> _Modules = new List<Module>();

        public Guid ID { get; set; }

        public Guid PortalID { get; set; }

        public string Name { get; set; }

        public int SortOrder { get; set; }

        public string AuthorizedRoles { get; set; }

        public string ThemeName { get; set; }

        public bool ShowLeftPane { get; set; }

        public bool ShowRightPane { get; set; }

        public IList<Module> Modules
        {
            get { return this._Modules; }
            set { this._Modules = value; }
        }

        public int Index { get; set; }

        public bool ShowOnMenu { get; set; }

        public Guid ParentID { get; set; }

        #region IComparable Members

        public int CompareTo(object value)
        {
            if (value == null) return 1;

            int compareOrder = ((Tab)value).SortOrder;

            if (this.SortOrder == compareOrder) return 0;
            if (this.SortOrder < compareOrder) return -1;
            if (this.SortOrder > compareOrder) return 1;
            return 0;
        }

        #endregion
    }
}